clear


import excel `"../Data/DsireNonMonetaryIncentives.xlsx"',  firstrow case(lower)


* get statefips
rename stateterritory state

drop if state=="HI" | state=="DC" | state=="VI"

/** Filters: Implementaing Sector: State
			 Eligible Sector: Residential
			 Technology: Solar Photovoltaics
*/

*** keep  only programs we care about
tab policyincentivetype

/*

                 Building Energy Code |          6        1.81        1.81
                Community Solar Rules |         19        5.72        7.53
                 Corporate Tax Credit |          3        0.90        8.43
              Equipment Certification |          1        0.30        8.73
                       Feed-in Tariff |          3        0.90        9.64
                        Grant Program |          3        0.90       10.54
             Green Building Incentive |          2        0.60       11.14
                      Interconnection |         45       13.55       24.70
                         Loan Program |         15        4.52       29.22
 Mandatory Utility Green Power Option |          1        0.30       29.52
                         Net Metering |         48       14.46       43.98
                      Other Incentive |          1        0.30       44.28
                         Other Policy |          1        0.30       44.58
                       PACE Financing |         12        3.61       48.19
          Performance-Based Incentive |          4        1.20       49.40
                  Personal Tax Credit |          7        2.11       51.51
               Personal Tax Deduction |          1        0.30       51.81
              Property Tax Assessment |          1        0.30       52.11
               Property Tax Incentive |         43       12.95       65.06
                 Public Benefits Fund |         22        6.63       71.69
                       Rebate Program |         10        3.01       74.70
        Renewables Portfolio Standard |          1        0.30       75.00
                  Sales Tax Incentive |         19        5.72       80.72
Solar Renewable Energy Credit Program |          9        2.71       83.43
             Solar/Wind Access Policy |         42       12.65       96.08
      Solar/Wind Permitting Standards |         12        3.61       99.70
                Value of Solar Tariff |          1        0.30      100.00


*/

tab category

keep if policyincentivetype=="Building Energy Code" | ///
		policyincentivetype=="Community Solar Rules" | ///
		policyincentivetype=="Equipment Certification" | ///
		policyincentivetype=="Green Building Incentive" | ///		
		policyincentivetype=="Loan Program" | ///
		policyincentivetype=="Mandatory Utility Green Power Option" | ///
		policyincentivetype=="PACE Financing" | ///
		policyincentivetype=="Solar/Wind Access Policy" | ///
		policyincentivetype=="Solar/Wind Permitting Standards"
		
		
		
gen financing=(policyincentivetype=="Loan Program" |  policyincentivetype=="PACE Financing")

gen access=(policyincentivetype=="Solar/Wind Access Policy" | policyincentivetype=="Solar/Wind Permitting Standards")

gen community=(policyincentivetype=="Community Solar Rules")

gen building=(policyincentivetype=="Building Energy Code" | policyincentivetype=="Green Building Incentive")

gen other=1-financing-access-community -building // (includes  "Equipment Certification" | "Mandatory Utility Green Power Option" ///


collapse (sum) financing (sum) access (sum) community (sum) building (sum) other, by(state)


save ../Data/CleanedData/DsireNonMonetaryState.dta, replace



	